home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / UTILITIE / CPU_MEMO / 0577.ZIP / MSUN.DOC < prev    next >
Text File  |  1987-02-27  |  6KB  |  175 lines

  1. MSUN.DOC by Doug Hogarth - Preliminary version - 02/26/87
  2.  
  3. Note:  Since this is a preliminary version, please limit distribution.
  4. Comments for the release version are encouraged.
  5.  
  6. This document attempts to explain many undocumented (or little documented)
  7. features of MS-DOS.  Most features are not guaranteed to work reliably or be
  8. present in future versions of MS-DOS, and should be avoided whenever possible.
  9.  
  10. MS-DOS Interrupts
  11. INT 28H
  12.  
  13. This interrupt is usually called during the keyboard routine as a hook for
  14. multi-tasking.
  15.  
  16. INT 29H - Video
  17.  
  18. This interrupt performs the INT 10H write TTY function in b/w, saving BP.
  19.  
  20. INT 2AH - Network (MS-DOS 3.0)
  21.  
  22. These are the NET functions.  AH=0 checks if installed, AH=3 checks if absolute
  23. disk access is allowed, AH=4 is EXEC NETBIOS, and AH=5 gets information.  There
  24. are other functions including 80H, 81H, 82H, and 84H which are called from MS-
  25. DOS.
  26.  
  27. INT 2EH
  28.  
  29. This interrupt is a quickie EXEC?
  30.  
  31. (INT 2FH - Multiplex)
  32.  
  33. This funtion is partially documented.  It is extended in network environments.
  34. Function B7H is the APPEND check, and Function B8H is the check for network
  35. software installed and get/set current post address.
  36.  
  37. Other Interrupts
  38. INT 33H - Mouse
  39.  
  40. INT 3FH - Overlay
  41.  
  42. INT 67H - EMM
  43.  
  44.  
  45. MS-DOS Functions
  46. Function 18H - Return Login Vector
  47.  
  48. This function in CP/M returned values in A and HL.  Set bits indicated that a
  49. drive was on-line.  It always returns zero.
  50.  
  51. Function 1DH - Get Read/Only Vector
  52.  
  53. This function in CP/M returned a value in HL.  Set bits indicated a read-only
  54. condition.  It always returns zero.
  55.  
  56. Function 1EH - Set File Attributes
  57.  
  58. This function in CP/M was passed an FCB address, and the DEC for that file was
  59. returned in A.  It does nothing.
  60.  
  61. Function 1FH - Get Disk Parameters
  62.  
  63. This function returns the address of disk parameters.  It returns DS:BX
  64. pointing to a table of parameters for the current drive.
  65.  
  66. Function 20H - Set/Get User Code
  67.  
  68. This function in CP/M would set the USER code (0-31), or get the current code
  69. in A if FFH.  It always returns zero.
  70.  
  71. (Function 30H - Get DOS Version Number) (MS-DOS 2.0)
  72.  
  73. This function is documented, but two return values are little documented.  BH
  74. returns the OEM number, and BL:CX returns a 24-bit user number (often zero).
  75. Some OEM values are 0:IBM (PC-DOS), 28H:TI, FFH:Others (MS-DOS).
  76.  
  77. Function 32H
  78.  
  79. This function is passed a drive code (0=default, 1=A, etc.) in DL, and returns
  80. AL=FFH if the drive is invalid.  Otherwise, DS:BX points to a table:
  81.  
  82. Offset 0 is a BYTE containing the drive (0=A, etc.)
  83. Offset 1 is a BYTE containing the unit within the drive (0, etc.)
  84. Offset 2 is a WORD count of the bytes per sector
  85. Offset 4 is a BYTE count of the sectors per cluster-1
  86. Offset 5 is a BYTE containing the sectors per cluster as a power of 2
  87. Offset 6 is a WORD count of the reserved sectors
  88. Offset 8 is a BYTE count of the FATs
  89. Offset 9 is a WORD count of the root directory entries
  90. Offset 0BH is a WORD containing the first data sector
  91. Offset 0DH is a WORD count of the number of clusters + 1
  92. Offset 0FH is a BYTE count of the sectors/FAT
  93. Offset 10H is a WORD containing the sector of the directory
  94. Offset 12H is a DWORD pointer to the device header
  95. Offset 16H is a BYTE containing the media descriptor
  96. Offset 17H is a BYTE containing 0 if the disk has been accessed
  97. Offset 18H is a DWORD pointer to the next block (or FFFFFFFF)
  98.  
  99. Function 34H - Get DOS Critical Flags (INDOS)
  100. (Note: This function is documented in technical information from Zenith)
  101. This function returns with ES:BX pointing to a byte count useful for TSR
  102. programs.  If this byte is non-zero, DOS functions greater than 0CH should not
  103. be used (a few like 30H, 59H, 33H, 50H, 51H, and 62H are okay).  The previous
  104. byte is a critical error byte - if it is set, TSR programs should not mess with
  105. anything.
  106.  
  107. Function 37H - SWITCHAR & AVAILDEV
  108.  
  109. DOS 2.0 and 2.10 allowed these two statements in CONFIG.SYS files.  They were
  110. implemented to make DOS more like Xenix in path names and switch characters.
  111. AL=0 gets SWITCHAR, AL=1 sets SWITCHAR, AL=2 gets AVAILDEV, AL=3 sets AVAILDEV.
  112. SWITCHAR and AVAILDEV are passed in DL.  If AVAILDEV=0, device names must be
  113. preceded by \DEV\.  Several programs from MS use this function.
  114.  
  115. Function 50H
  116.  
  117. This function sets the current PSP.  BX is the segment address.
  118.  
  119. Function 51H - Get PSP Address
  120.  
  121. This function gets the current PSP.  See function 62H in MS-DOS 3.0 or later.
  122. TopView uses this.
  123.  
  124. Function 52H - IVARS
  125.  
  126. This function returns a pointer to a DWORD containing the DS:BX value for
  127. function 32H, DL=1.  See function 32H for details.
  128.  
  129. Function 53H
  130.  
  131. This function is passed DS:SI pointing to a BIOS parameter block table, and
  132. ES:BP pointing to a table.  It returns with the destination table translated
  133. from the source.
  134.  
  135. Function 55H
  136.  
  137. This function has something to do with the DTA?
  138.  
  139. Function 58H - Get/Set Allocation Strategy (MS-DOS 3.0)
  140. (Note: This function is documented by MS in Advanced MS-DOS)
  141. AL=0 means get the current strategy, AL=1 means set the strategy.  The strategy
  142. code in BX is 0:First fit, 1:Best fit, and 2:Last fit.
  143.  
  144. Function 5DH
  145.  
  146. This function has something to do with restoring the extended error
  147. information?
  148.  
  149. Function 60H - Get Directory
  150.  
  151. This function copies the default drive and current directory (ASCIIZ) to the
  152. address specified by ES:DI.  AL contains one of the characters from the
  153. routine.
  154.  
  155. Function 61H - Reserved
  156.  
  157. Function 63H - Get/Set Lead Byte Table (MS-DOS 2.25 ONLY)
  158. (Note: This function is documented by MS in Advanced MS-DOS)
  159.  
  160. Function 64H - (MS-DOS 3.20)
  161.  
  162. This function passes a counter in AL.
  163.  
  164. Function 89H - Sleep
  165. (This function was mentioned in the MSC 4.0 startup code)
  166.  
  167. Function F8H - Set OEM Interrupt Handler
  168.  
  169. DS:DX points to the handler which ends with IRET.  Use FFFF:FFFF to reset.
  170. Don't remember where this info came from, and it is not currently present.
  171.  
  172. Functions F9-FFH - OEM Interrupts
  173.  
  174. These functions return with carry set and AX=1 (?) if not initialized.